import request from '@/utils/request'

// 查询实验方案列表
export function listScheme(query) {
  return request({
    url: '/business/scheme/list',
    method: 'get',
    params: query
  })
}

// 查询实验方案详细
export function getScheme(schemeId) {
  return request({
    url: '/business/scheme/' + schemeId,
    method: 'get'
  })
}

// 新增实验方案
export function addScheme(data) {
  return request({
    url: '/business/scheme',
    method: 'post',
    data: data
  })
}

// 修改实验方案
export function updateScheme(data) {
  return request({
    url: '/business/scheme',
    method: 'put',
    data: data
  })
}

// 删除实验方案
export function delScheme(schemeId) {
  return request({
    url: '/business/scheme/' + schemeId,
    method: 'delete'
  })
}

// 导出实验方案
export function exportScheme(query) {
  return request({
    url: '/business/scheme/export',
    method: 'get',
    params: query
  })
}

// 开始采集
export function startCollectBySchemeId(schemeId) {
  return request({
    url: '/business/scheme/startCollect?schemeId=' + schemeId,
    method: 'get',
  })
}

// 结束采集
export function stopCollect() {
  return request({
    url: '/business/scheme/stopCollect',
    method: 'get',
  })
}

export function getCollectingStatus() {
  return request({
    url: '/business/scheme/getCollectingStatus',
    method: 'get',
  })
}

export function getSchemeData(query) {
  return request({
    url: '/business/scheme/getSchemeData',
    method: 'get',
    params: query
  })
}
